# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html


class QiushibaikePipeline(object):
    def process_item(self, item, spider):
        filename = 'qiushi.txt'
        with open(filename, 'a') as fp:
            fp.write(item['author'])
            fp.write('\n')
            fp.write(item['img'])
            fp.write('\n')
            fp.write(item['content'])
            fp.write('\n')
            fp.write(item['fun_num'])
            fp.write('\t')
            fp.write(item['talk_num'])
            fp.write('\n')

        return item
